import express from 'express'
import userAuth from '@/middlewares/user-auth'
import authRouter from '@/routes/auth'
import usersRouter from '@/routes/users'
import brandsRouter from '@/routes/brands'
import uploadsRouter from '@/routes/uploads'
import categoriesRouter from '@/routes/categories'
import attributesRouter from '@/routes/attributes'
import attrvaluesRouter from '@/routes/attrvalues'
import attachmentsRouter from '@/routes/attachments'
import logsRouter from '@/routes/logs'
import rolesRouter from '@/routes/roles'
import ordersRouter from '@/routes/orders'
import payRouter from '@/routes/pay'

const router = express.Router()

router.use('/auth', authRouter)
router.use('/users', userAuth, usersRouter)
router.use('/brands', userAuth, brandsRouter)
router.use('/uploads', userAuth, uploadsRouter)
router.use('/categories', userAuth, categoriesRouter)
router.use('/attributes', userAuth, attributesRouter)
router.use('/attrvalues', userAuth, attrvaluesRouter)
router.use('/attachments', userAuth, attachmentsRouter)
router.use('/logs', userAuth, logsRouter)
router.use('/roles', userAuth, rolesRouter)
router.use('/orders', userAuth, ordersRouter)
router.use('/pay', payRouter)

export default router
